
package jogoprojetopi;

import s3t.gameControl.GameCore;
import s3t.gameControl.system.GameSystem;
import s3t.gameControl.timer.TimerAction;
import s3t.gameControl.timer.TimerControl;
import s3t.gameElements.Camera;
import s3t.gameElements.Scenario;
import s3t.gameElements.ScenarioItem;
import s3t.gameElements.ScenarioLayer;
import s3t.gameElements.eScenarioBehavior;
import s3t.graphicsElements.SimpleImage;


public class MenuState implements TimerAction {


    private Scenario titleScreen = new Scenario( "1", "TitleScreen", 800, 600 );
    private ScenarioLayer bgTitleScreen = new ScenarioLayer( "TitleBg", eScenarioBehavior.UPPER );
    private ScenarioLayer bgTitleScreenSwap = new ScenarioLayer( "bgTitleScreenSwap", eScenarioBehavior.UPPER );
    private ScenarioLayer fadeLayer = new ScenarioLayer( "FadeLayer", eScenarioBehavior.UPPER );
    private TimerControl loop;


    public void load()
    {
        try
        {
            
            ScenarioItem img1 = new ScenarioItem( "titleBg1", new SimpleImage( "/TITLE_SCREEN_1.png" ), 400, 290);
            ScenarioItem img2 = new ScenarioItem( "titleBg2", new SimpleImage( "/TITLE_SCREEN_2.png" ), 400, 290);

            bgTitleScreen.addScenarioItem( img1 );
            bgTitleScreenSwap.addScenarioItem( img2 );

            titleScreen.addScenarioLayer( bgTitleScreen );
            titleScreen.addScenarioLayer( bgTitleScreenSwap );
            bgTitleScreenSwap.setVisible(false);

            titleScreen.addScenarioLayer( fadeLayer );

            GameSystem.getInstance().getScenarioCollection().addScenario( titleScreen );
            bgTitleScreen.setVisible( true );

            Camera camera = new Camera();
            GameSystem.getInstance().getGraphicEngine().setCamera( camera );
            

        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }

    }

   

    @Override
    public void doAction( GameCore gameCore )
    {

    }


}
